import { Rule, RuleType, getSchema } from '@midwayjs/validate';
const requiredString = RuleType.string().required();

export class BloodRoutineIndicatorsDTO {
  @Rule(requiredString.min(2).max(200))
  recordId: string;
  @Rule(requiredString.min(2).max(200))
  patientId: string;
  @Rule(RuleType.number().required().min(0))
  RBC: number;
  @Rule(RuleType.number().required().min(0))
  HGB: number;
  @Rule(RuleType.number().required().min(0))
  HCT: number;
  @Rule(RuleType.number().required().min(0))
  MCV: number;
  @Rule(RuleType.number().required().min(0))
  MCH: number;
  @Rule(RuleType.number().required().min(0))
  MCHC: number;
  @Rule(RuleType.number().required().min(0))
  RDW: number;
@Rule(RuleType.date())
createdAt: Date;
}
export class UploadBloodSmearImagesDTO {
  @Rule(requiredString.min(2).max(200))
  patientId: string;
  @Rule(requiredString.min(2).max(200))
  recordId: string;
}
export class probability {
  @Rule(RuleType.number().required().min(0))
  地中海贫血: number;
  @Rule(RuleType.number().required().min(0))
  缺铁性贫血: number;
  @Rule(RuleType.number().required().min(0))
  正常: number;
}
export class DetailsDTO {
  @Rule(requiredString.min(2).max(200))
  imgPath: string;
  @Rule(requiredString.min(2).max(30))
  type: string;
  @Rule(RuleType.number().required().min(0))
  quantity: number;
  @Rule(requiredString.min(0))
  percentage: string;
}
export class imgDetailDTO {
  @Rule(RuleType.number().required().min(0))
  total: number;
  @Rule(requiredString.min(2).max(200))
  originalImageUrl: string;
  @Rule(RuleType.array().items(getSchema(DetailsDTO)).required())
  details: DetailsDTO[];
}

export class SaveRecordDTO {
  @Rule(requiredString.min(2).max(200))
  recordId: string;
  @Rule(requiredString.min(2).max(200))
  patientId: string;
  @Rule(getSchema(BloodRoutineIndicatorsDTO).required())
  bloodDrooping: BloodRoutineIndicatorsDTO;
  @Rule(RuleType.array().items(getSchema(imgDetailDTO)).required())
  imgDetail: imgDetailDTO[];
  @Rule(getSchema(probability).required())
  probability: probability;
  @Rule(RuleType.string().min(0).max(255))
  txt: string;
  @Rule(RuleType.string().min(0).max(255))
  oldRecordId: string;
}